package cn.edu.lingnan.mapper;

import cn.edu.lingnan.domain.Dto.*;
import cn.edu.lingnan.domain.Vo.JoinProjectVo;
import cn.edu.lingnan.domain.Vo.ProjectVo;
import cn.edu.lingnan.domain.Vo.User_ProjectVo;
import cn.edu.lingnan.domain.pojo.Order;
import cn.edu.lingnan.domain.pojo.Project;
import cn.edu.lingnan.domain.pojo.Teacher;
import cn.edu.lingnan.domain.pojo.UserProject;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProjectMapper {
    Page<Project> list(ProjectDto projectDto);

    ProjectVo findProjectById(Integer id);

    Teacher findProjectTeacherById(Integer teacherId);

    List<Project> findProjectByTeacherId(Integer teacherId);

    List<Integer> findProjectStudentIds(Integer id);

    void deleteMember(@Param("projectId") Integer projectId, @Param("userId") Integer userId);

    void stopProject( @Param("projectId") Integer projectId, @Param("status") Integer status);

    void deleteMembers(Integer projectId);

    void deleteProject(Integer projectId);

    void updateProject(UpdateProjectDto updateProjectDto);

    void addProject(AddProjectDto addProjectDto);

    List<Project> selectProjectExcel();

    Integer listProjectByStudentId(Integer userId);

    Integer listProjectMemberByStudentId(Integer userId);

    void joinProject(@Param("userId") Integer userId, @Param("projectId") Integer projectId);

    Integer findProjectByStudentIdAndProjectId(@Param("userId") Integer userId, @Param("projectId") Integer projectId);

    Integer findProjectMemberByStudentIdAndProjectId(@Param("userId") Integer userId, @Param("projectId") Integer projectId);

    @Select("SELECT * FROM tb_club.user_project WHERE status = 0")
    List<UserProject> findJoinProject();

    JoinProjectVo findJoinProjectById(Integer projectId);

    void agreeJoinProject( @Param("projectId") Integer projectId, @Param("userId") Integer userId);

    void refuseJoinProject(RejectJoin rejectJoin);

    List<UserProject> findMyJoinProject ( @Param("userId")   Integer userId, @Param("status") Integer status);

    void cancelApply( @Param("userId") Integer userId, @Param("projectId") Integer projectId);

    List<Project> listMyProject( @Param("userId") Integer userId, @Param("status") Integer status);

    List<Project> listMyProjectNotType(Integer userId);

    void cancelProject(Integer projectId);

    List<Project> listMyProjectReject( @Param("userId") Integer userId, @Param("status") Integer status);

    List<Project> listNeedCheckProject();

    void checkProject(RejectOrAgreeCreate rejectOrAgreeCreate);

    Integer countProject();

    List<Order> listProjectBy7();

    Integer countNeedCheckProject();

    Integer countNeedCheckApply();
}
